package com.yanqu.road.server.logic.recharge.limit;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.tonbing.config.TonBingConfig;
import com.yanqu.road.entity.activity.tonbingchannel.config.ChannelTonBingConfig;
import com.yanqu.road.entity.config.goods.MallInfo;
import com.yanqu.road.entity.enums.eMallCategory;
import com.yanqu.road.server.logic.recharge.limit.activity.*;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.tonbing.TonBingMgr;
import com.yanqu.road.server.manger.activity.tonbingchannel.ChannelTonBingMgr;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class MallLimitFactory {
    private static Logger logger = LogManager.getLogger(MallLimitFactory.class.getName());
    public static BaseRMBMallLimit getMallLimit(long userId, MallInfo mallInfo, ActivityInfo activityInfo){
        if(null == mallInfo){
            logger.error("MallLimitFactory getMallLimit fail,mallInfo is null");
            return null;
        }
        if(mallInfo.getCategory() == eMallCategory.Ingots.getValue()){
            return new IngotsMallLimit(userId, mallInfo);
        }else if(mallInfo.getCategory() == eMallCategory.PrivilegeCard.getValue()){
            return new PrivilegeCardMallLimit(userId, mallInfo);
        }else if(mallInfo.getCategory() == eMallCategory.Fund.getValue()){
            return new FundMallLimit(userId, mallInfo);
        }else if(mallInfo.getCategory() == eMallCategory.SecretVolume.getValue()){
            return new SecretVolumeMallLimit(userId, mallInfo);
        }else if(mallInfo.getCategory() == eMallCategory.RechargeGoods.getValue()){
            return new RechargeActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.CrossRankRMBMall.getValue()) {
            return new CrossRankActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.TriggerRMBMall.getValue()) {
            return new TriggerActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.HuaShiGangRMBMall.getValue()) {
            return new HuaShiGangActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.FiveHeroRecharge.getValue()) {
            return new FiveHeroActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.DunHuangShiKuRMBMall.getValue()) {
            return new DunHuangActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.DaFuWengRMBMall.getValue()) {
            return new DaFuWengActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.UnionWarRMBMall.getValue()) {
            return new UnionWarActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.CookBoy2Bag.getValue()) {
            return new CookBoy2ActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.CookBoy3Bag.getValue()) {
            return new CookBoy3ActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.ChefDuel2Bag.getValue()) {
            return new ChefDuel2ActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.ChefDuel3Bag.getValue()) {
            return new ChefDuel3ActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.ReissueMall.getValue()) {
            return new ReissueActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.ZhanLingGiftBag.getValue()) {
            return new ZhanLingActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.DouLuoDaLuRMBMall.getValue()) {
            return new DouLuoActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.ChannelRankRMBMall.getValue()) {
            return new ChannelRankActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.ChineseChessToken.getValue()) {
            return new ChineseChessActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.TongBingRedPacketMall.getValue()) {
            return new TongbingActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.ChuHanRmbMall.getValue()) {
            return new ChuHanActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.SuiTangMall.getValue()) {
            return new SuiTangActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.TonBingRedPacketMall.getValue()) {
            //东西用同一个吧
            TonBingConfig config = TonBingMgr.getConfig();
            ChannelTonBingConfig cconfig = ChannelTonBingMgr.getConfig();
            if(config != null && ActivityMgr.activityInShowTime(config.getActivityInfo())){
                return new TonbingActivityMallLimit(userId, mallInfo, activityInfo);
            }
            if(cconfig != null && ActivityMgr.activityInShowTime(cconfig.getActivityInfo())){
                return new ChannelTonbingActivityMallLimit(userId, mallInfo, activityInfo);
            }
            return null;
        }else if(mallInfo.getCategory() == eMallCategory.RankUnionWarRMBMall.getValue()) {
            return new RankUnionWarActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.PastureToken.getValue()) {
            return new PastureActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.GreatTradeCard.getValue()) {
            return new GreatTradeActivityMallLimit(userId, mallInfo, activityInfo);
        }else if(mallInfo.getCategory() == eMallCategory.GoldTokeMall.getValue()) {
            return new GoldTokenMallLimit(userId, mallInfo, activityInfo);
        }else if (mallInfo.getCategory() == eMallCategory.WasheToken.getValue()) {
            return new WasheMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.WasheRmbMall.getValue()) {
            return new WasheRmbMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.CricketRmbMall.getValue()) {
            return new CricketActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.FlowerCardMall.getValue()) {
            return new FlowerCardActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.OperaMaskToken.getValue()) {
            return new OperaMaskMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.ReturnRmbMall.getValue()) {
            return new OldPlayerMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.ReturnRoleOnlyPrivilegeCard.getValue()) {
            return new OldPlayerMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.CricketCourtToken.getValue()) {
            return new CricketCourtMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.WasheRmbMallDirect.getValue()) {
            return new WaSheDirectRmbMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.FestivalGift.getValue()) {
            return new FestivalGiftActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.QixiRecharge.getValue()) {
            return new QixiRmbMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.TenDaysDiscountMall.getValue()){
            return new TenDayDiscountMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.EveFeastToken.getValue()) {
            return new EveFeastActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.TongBaoRecharge.getValue()){
            return new TongBaoMallLimit(userId, mallInfo);
        } else if (mallInfo.getCategory() == eMallCategory.PatronsFund.getValue()) {
            return new PatronsFundMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.JinLi.getValue()) {
            return new JinLiRmbMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.SteleSoul.getValue()){
            return new SteleSoulRmbMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.NewFirstRechargeCash.getValue()){
            return new NewFirstRechargeCashMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.NewFirstRecharge2024.getValue()){
            return new NewFirstRecharge2024MallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.JiuZhou.getValue()){
            return new JiuZhouRmbMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.SnowGardenToken.getValue()) {
            return new SnowGardenTokenActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.SummerGamesFound.getValue()) {
            return new SummerGamesFoundActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.ServerAllBuyMall.getValue() || mallInfo.getCategory() == eMallCategory.ServerAllSecondBuyMall.getValue()) {
            return new ServerBuyRmbLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.SummerGamesAllMall.getValue()) {
            return new SummerGamesServerBuyRmbLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.SystemOpenTriggerRMBMall.getValue()) {
            return new SystemOpenTriggerActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.DoubleSpringZlMallZl.getValue()) {
            return new DoubleSpringZlMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.DoubleSpringZlMallHelp.getValue()) {
            return new DoubleSpringHelpMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.ZhenHuanThirdProcessRecharge.getValue()) {
            return new ZhenHuanThirdProcessActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.BiaoJu.getValue()) {
            return new BIaoJuActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.SonHaiZl.getValue()) {
            return new SonHaiZlMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.SonHaiGift.getValue()) {
            return new SonHaiGiftMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.HsIslandZl.getValue()) {
            return new HsIslandZlMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.CombLeaderFund.getValue()) {
            return new CombLeaderFundActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.HorseRun.getValue()) {
            return new HorseRunActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.GoldIngotFund.getValue()) {
            return new GoldIngotFundActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.HotpotJump.getValue()) {
            return new HotpotActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.StarLight.getValue()) {
            return new StarLightMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.ApprenticeTgMall.getValue()) {
            return new ApprenticeServerBuyRmbLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.ApprenticeFund.getValue()) {
            return new ApprenticeFoundActivityMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.WealthScrollBuyToken.getValue()) {
            return new WealthScrollLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.NewPatronFund.getValue()) {
            return new NewPatronsFundMallLimit(userId, mallInfo, activityInfo);
        } else if (mallInfo.getCategory() == eMallCategory.IceServerGift.getValue()) {
            return new IceServerGiftMallLimit(userId, mallInfo, activityInfo);
        } else {
            return null;
        }
    }
}
